package com.gsafety.wellsfort.service.security;

import com.gsafety.wellsfort.common.util.ApiResponse;
import com.gsafety.wellsfort.domain.dto.ids.KnowledgeQueryDto;
import com.gsafety.wellsfort.domain.dto.ids.OrganizationDto;
import com.gsafety.wellsfort.domain.form.RoleForm;
import com.gsafety.wellsfort.domain.form.Tree;
import com.gsafety.wellsfort.domain.model.security.Role;
import com.gsafety.wellsfort.domain.vo.KnowledgeResultVO;
import com.gsafety.wellsfort.domain.vo.QueryVO;
import com.gsafety.wellsfort.domain.vo.security.RoleVO;

import java.util.List;

public interface IRoleService {
    boolean addRole(RoleVO roleVO);

    boolean updateRole(RoleVO roleVO);

    boolean setPermission(RoleForm roleForm);

    /**
     * 分页查询
     *
     * @param params 查询参数
     * @return
     */
    ApiResponse<List<Role>> pageQuery(QueryVO query);

    ApiResponse<List<Tree>> getPermission(Integer roleId);

    /**
     * 根据权限码判断用户是否有操作权限
     *
     * @param opCode
     * @return
     */
    ApiResponse checkPermission(String opCode);

    Role get(Integer rolId);

    ApiResponse<List<KnowledgeResultVO>> getKnowledgePermission(KnowledgeQueryDto knowledgeQueryDto);

    ApiResponse<List<Role>> getAllByGroup(Integer schoolId);
}
